home *** CD-ROM | disk | FTP | other *** search
-
- #include <string.h>
- #include "netbios.h"
-
- /*****************************************************
- * max_dg - Determine largest acceptable datagram size
- * Parameters:
- * Returns: Maximum valid datagram size in bytes
- * Notes: This code assumes that you are using a memory
- * model which will result in buffer being a far
- * pointer.
- * History: Original code by William H. Roetzheim, 1990
- ******************************************************/
-
- int max_dg()
- {
- struct net_control_block ncb;
- int length = 0;
-
- init_ncb(&ncb);
- while (ncb.retcode == 0)
- {
- length++;
- init_ncb(&ncb);
- ncb.command = NCB_SEND_DATAGRAM;
- ncb.length = length;
- ncb.number = 0x01; /* use adapter standard name */
- int_netbios(&ncb);
- }
- return length -1;
- }
-
-